﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class User_Home : System.Web.UI.Page
{
    BouquetBUS bouBUS = new BouquetBUS();
    ShoppingCartBUS cartBUS = new ShoppingCartBUS();
    protected void Page_Load(object sender, EventArgs e)
    {
        dlHome.DataSource = DisplayHome();
        dlHome.DataBind();
    }
    public DataTable DisplayHome()
    {
        DataTable tbProduct = new DataTable();
        tbProduct = bouBUS.returnBouquetByHome();
        return tbProduct;
    }

    protected void dlHome_ItemCommand(object source, DataListCommandEventArgs e)
    {

        if (e.CommandName.Equals("AddCart"))
        {
            cartBUS.Add(e.CommandArgument.ToString(), 1);
            Response.Redirect("ShoppingCart.aspx");
        }
    }
}